From 1eb8d2ad09412ac397c6039c56354f72f4996bad Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 31 Jul 2017 17:25:56 +0800 Subject: [PATCH] MSVC builds: Allow different Python versions per toolset Use conditionals to select the Python installation, so that we can stick closer to the default Visual Studio versions used to compile each official Python releases. This means by default: -2013 builds use Python 3.4.x, which is built with 2010 -2015 and 2017 builds use Python 3.6.x, which is built with 2015. Also rename PythonPath/PythonPathX64 in the property sheets to PythonDir/PythonDirX64 repsectively, as PythonPath is the envvar name where additional Python modules is searched for, so we don't want to get confused with it. Last but not least, distinguish between the Python interpretors that are used on x64 and x86/32-bit builds for generating the libgtk4.manifest file and the gdbus-generated sources, for consistency reasons. --- win32/vs12/gtk-4.vcxprojin | 51 ++++++++------------------ win32/vs12/gtk4-gen-srcs.props | 10 +++-- win32/vs12/gtk4-install.propsin | 4 +- win32/vs12/gtk4-version-paths.props.in | 14 ++++--- 4 files changed, 32 insertions(+), 47 deletions(-) diff --git a/win32/vs12/gtk-4.vcxprojin b/win32/vs12/gtk-4.vcxprojin index 1561e15479..3b8f402b7a 100644 --- a/win32/vs12/gtk-4.vcxprojin +++ b/win32/vs12/gtk-4.vcxprojin @@ -316,46 +316,25 @@ - Generating GTK+ DBus Sources... - $(GenerateGtkDbusBuiltSources) - ..\..\gtk\gtkdbusgenerated.c;..\..\gtk\gtkdbusgenerated.h;%(Outputs) - Generating GTK+ DBus Sources... - $(GenerateGtkDbusBuiltSources) - ..\..\gtk\gtkdbusgenerated.c;..\..\gtk\gtkdbusgenerated.h;%(Outputs) - Generating GTK+ DBus Sources... - $(GenerateGtkDbusBuiltSources) - ..\..\gtk\gtkdbusgenerated.c;..\..\gtk\gtkdbusgenerated.h;%(Outputs) - Generating GTK+ DBus Sources... - $(GenerateGtkDbusBuiltSources) - ..\..\gtk\gtkdbusgenerated.c;..\..\gtk\gtkdbusgenerated.h;%(Outputs) + Generating GTK+ DBus Sources... + $(GenerateGtkDbusBuiltSources) + ..\..\gtk\gtkdbusgenerated.c;..\..\gtk\gtkdbusgenerated.h;%(Outputs) + Generating GTK+ DBus Sources... + $(GenerateGtkDbusBuiltSourcesX64) + ..\..\gtk\gtkdbusgenerated.c;..\..\gtk\gtkdbusgenerated.h;%(Outputs) - Copying GTK+ Win32 Version Resource... - $(CopyGtkWin32RC) - ..\..\gtk\gtk-win32.rc;%(Outputs) - Copying GTK+ Win32 Version Resource... - $(CopyGtkWin32RC) - ..\..\gtk\gtk-win32.rc;%(Outputs) - Copying GTK+ Win32 Version Resource... - $(CopyGtkWin32RC) - ..\..\gtk\gtk-win32.rc;%(Outputs) - Copying GTK+ Win32 Version Resource... - $(CopyGtkWin32RC) - ..\..\gtk\gtk-win32.rc;%(Outputs) + Copying GTK+ Win32 Version Resource... + $(CopyGtkWin32RC) + ..\..\gtk\gtk-win32.rc;%(Outputs) - Generating GTK+ Win32 Manifest... - $(GenerateGtkWin32Manifest) - ..\..\gtk\libgtk4.manifest;%(Outputs) - Generating GTK+ Win32 Manifest... - $(GenerateGtkWin32Manifest) - ..\..\gtk\libgtk4.manifest;%(Outputs) - Generating GTK+ Win32 Manifest... - $(GenerateGtkWin32Manifest) - ..\..\gtk\libgtk4.manifest;%(Outputs) - Generating GTK+ Win32 Manifest... - $(GenerateGtkWin32Manifest) - ..\..\gtk\libgtk4.manifest;%(Outputs) + Generating GTK+ Win32 Manifest... + $(GenerateGtkWin32Manifest) + ..\..\gtk\libgtk4.manifest;%(Outputs) + Generating GTK+ Win32 Manifest... + $(GenerateGtkWin32ManifestX64) + ..\..\gtk\libgtk4.manifest;%(Outputs) diff --git a/win32/vs12/gtk4-gen-srcs.props b/win32/vs12/gtk4-gen-srcs.props index a085324e96..c611d740aa 100644 --- a/win32/vs12/gtk4-gen-srcs.props +++ b/win32/vs12/gtk4-gen-srcs.props @@ -39,10 +39,11 @@ echo $(Configuration) > ..\..\MSVC_$(Configuration)_Vulkan :DONE_GDKCONFIG_H $(GlibEtcInstallRoot)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml - cd ..\..\gtk & $(PythonPath)\python $(GDbusCodeGenCmd) & cd $(SolutionDir) - cd ..\..\gtk & $(PythonPathX64)\python $(GDbusCodeGenCmd) & cd $(SolutionDir) + cd ..\..\gtk & $(PythonDir)\python $(GDbusCodeGenCmd) & cd $(SolutionDir) + cd ..\..\gtk & $(PythonDirX64)\python $(GDbusCodeGenCmd) & cd $(SolutionDir) copy ..\..\gtk\gtk-win32.rc.body ..\..\gtk\gtk-win32.rc - $(PythonPath)\python ..\replace.py --action=replace-var --input=..\..\gtk\libgtk4.manifest.in --output=..\..\gtk\libgtk4.manifest --var=EXE_MANIFEST_ARCHITECTURE --outstring=* + $(PythonDir)\python ..\replace.py --action=replace-var --input=..\..\gtk\libgtk4.manifest.in --output=..\..\gtk\libgtk4.manifest --var=EXE_MANIFEST_ARCHITECTURE --outstring=* + $(PythonDirX64)\python ..\replace.py --action=replace-var --input=..\..\gtk\libgtk4.manifest.in --output=..\..\gtk\libgtk4.manifest --var=EXE_MANIFEST_ARCHITECTURE --outstring=* copy ..\..\demos\gtk-demo\demos.h.win32 ..\..\demos\gtk-demo\demos.h (cd ..) & (call gen-enums.bat $(GlibEtcInstallRoot)) & (cd $(SolutionDir)) @@ -87,6 +88,9 @@ $(GlibEtcInstallRoot)\bin\glib-compile-resources.exe --sourcedir=..\..\gsk --c-n $(GenerateGtkWin32Manifest) + + $(GenerateGtkWin32ManifestX64) + $(CopyDemosH) diff --git a/win32/vs12/gtk4-install.propsin b/win32/vs12/gtk4-install.propsin index 7a9f2b3747..ac5fbea5bb 100644 --- a/win32/vs12/gtk4-install.propsin +++ b/win32/vs12/gtk4-install.propsin @@ -104,8 +104,8 @@ $(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\sch echo "Generating icon cache..." $(CopyDir)\bin\gtk$(ApiVersionShort)-update-icon-cache.exe --ignore-theme-index --force "$(CopyDir)\share\icons\hicolor" - $(PythonPath)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) --host=i686-pc-vs$(VSVer) - $(PythonPathX64)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) --host=x86_64-pc-vs$(VSVer) + $(PythonDir)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) --host=i686-pc-vs$(VSVer) + $(PythonDirX64)\python ..\gtkpc.py --prefix=$(CopyDir) --version=$(GtkVersion) --host=x86_64-pc-vs$(VSVer) ..\gtk+-$(ApiVersion).pc diff --git a/win32/vs12/gtk4-version-paths.props.in b/win32/vs12/gtk4-version-paths.props.in index 3b1da887a6..d9f504b322 100644 --- a/win32/vs12/gtk4-version-paths.props.in +++ b/win32/vs12/gtk4-version-paths.props.in @@ -13,8 +13,10 @@ -vs$(VSVer) $(GtkSeparateVSDllPrefix) $(GtkSeparateVSDllSuffix) - c:\python34 - $(PythonPath).x64 + c:\\python34 + c:\\python36 + c:\\python36 + $(PythonDir).x64 <_PropertySheetDisplayName>gtk4versionpathsprops @@ -56,11 +58,11 @@ $(GtkDllSuffix) - - $(PythonPath) + + $(PythonDir) - - $(PythonPathX64) + + $(PythonDirX64) -- 2.30.2